<template>
	<view class="hotel-popup">
		<!-- <view class="title">{{suitDetail.title}}<view @click="closePopup" class="iconfont">&#xe688;</view></view> -->
		<scroll-view class="scroll-con" :scroll-y="true">
			<view class="detail-content">
				<view class="hotel-detail-info">
					<view class="item">
						<view class="c-title">说明</view>
						<view class="content">
							<jyf-parser :html="suitDetail.description"></jyf-parser>
						</view>
					</view>
				</view>
			</view>
		</scroll-view>
		<view class="popup-btns-block" v-if="suitDetail.price && suitDetail.price != '0'">
			<view class="price"><text class="color">{{globalExchangeRate}}<text class="number">{{suitDetail.price}}</text></text>起</view>
			<!-- #ifdef MP-ALIPAY -->
			<button class="booking-btn" type="default" hover-class="none" scope="userInfo" open-type="getAuthorize" @getAuthorize="book">立即预订</button>
			<!-- #endif -->
			<!-- #ifdef MP-WEIXIN -->
			<button class="booking-btn" type="default" hover-class="none" @click="book">立即预订</button>
			<!-- #endif -->
			<!-- #ifdef MP-TOUTIAO || H5 || APP-PLUS -->
			<button class="booking-btn" type="default" hover-class="none" open-type="getUserInfo" @click="book">立即预订</button>
			<!-- #endif -->
		</view>
	</view>
</template>

<script>
	/**
	 * 套餐说明
	 * 
	 */
	export default {
		name: 'stTyDetailInfo',
		props: {
			suitDetail: {
				type: Object,
				default: {}
			},
			price: {
				type: String,
				default: ''
			},
		},
		data() {
			return {
				couponCurrent: 1, //弹窗swiper
			};
		},
		methods: {
			// 弹窗swiper
			couponSwiperChange(e) {
				this.couponCurrent = e.detail.current + 1
			},

			closePopup() {
				this.$emit('close')
			},
			book() {
				this.$emit('goToBook', this.suitDetail.id);
			},
		}
	}
</script>

<style lang="scss">

	.hotel-popup {
		background-color: $uni-bg-color;
		font-size: $uni-font-size-sm;

		.title {
			@extend .ellipse;
			position: relative;
			height: 86rpx;
			padding: 0 3em;
			line-height: 86rpx;
			font-size: $uni-font-size-lg;
			text-align: center;
			border-bottom: 1rpx solid $uni-border-color;

			.iconfont {
				position: absolute;
				right: 25rpx;
				top: 0;
			}
		}

		.scroll-con {
			max-height: 700rpx;
			min-height: 100rpx;
			overflow-y: auto;
		}

		.swiper {
			position: relative;

			.popup-swiper,
			image {
				height: 400rpx;
			}

			image {
				width: 100%;
			}

			.number-plan {
				position: absolute;
				right: 25rpx;
				bottom: 20rpx;
				width: 114rpx;
				height: 40rpx;
				@extend .alignJustify;
				border-radius: 20rpx;
				background-color: rgba(0, 0, 0, .6);
				color: $uni-text-color-inverse;

				.iconfont {
					margin-right: 10rpx;
					font-size: 28rpx;
				}
			}
		}

		.detail-content {
			padding: 0 25rpx;
		}

		.attr-list {
			padding: 25rpx 0 17rpx;
			border-bottom: 1rpx solid $uni-border-color;
			font-size: $uni-font-size-mini;

			.list-con {
				@extend .displayflex;
				flex-wrap: wrap;
				margin-left: -8rpx;
			}

			.first,
			.item {
				height: 30rpx;
				margin: 0 0 8rpx 8rpx;
				padding: 0 12rpx;
				border-radius: 3rpx;
			}

			.first {
				line-height: 30rpx;
				color: #ff8800;
				background-color: #fff3e5;
			}

			.item {
				box-sizing: border-box;
				line-height: 28rpx;
				color: $uni-text-color-primary;
				border: 1rpx solid $uni-color-primary;
			}
		}

		.hotel-detail-info {
			.c-title {
				margin-bottom: 24rpx;
				font-size: $uni-font-size-base;
			}

			.item {
				padding: 30rpx 0 20rpx;
				border-bottom: 1rpx solid $uni-border-color;

				&.detail {
					.c-title {
						margin-bottom: 6rpx;
					}

					.content {
						@extend .displayflex;
						flex-wrap: wrap;
						line-height: 2;
						color: $uni-text-color;
					}

					.con-item {
						width: 338rpx;

						&:nth-child(odd) {
							margin-right: 22rpx;
						}
					}

					.label {
						color: $uni-text-color-grey;
					}
				}

				&.facility {
					line-height: 1.5;

					.c-title {
						margin-bottom: 16rpx;
					}

					.con-item {
						@extend .displayflex;
						margin-bottom: 22rpx;
					}

					.label {
						width: 170rpx;
						color: $uni-text-color-grey;
					}

					.text {
						width: 500rpx;
						@extend .flex1;
						color: $uni-text-color-deep;
					}
				}

				.content {
					line-height: 1.5;
					color: $uni-text-color-deep;
				}

				&:last-child {
					border-bottom: none;
				}
			}
		}

		.popup-btns-block {
			@extend .justifyspacec;
			height: 98rpx;
			// box-shadow: 0px 10rpx 10rpx 8rpx rgba(11, 2, 5, 0.5);
			background-color: $uni-bg-color;
			padding: 8rpx 24rpx;

			.price {
				@extend .flex1;
				font-size: $uni-font-size-sm;
				color: $uni-text-color-grey;
				font-family: Arial, Helvetica, sans-serif;
				.color{
					color: #ff4a50;
					.number {
						font-size: 38rpx;
						font-weight: bold;
					}
				}
			}

			.booking-btn {
				@extend .alignJustify;
				height: 84rpx;
				width: 450rpx;
				background: linear-gradient(270deg, #FF644E 0%, #FF8A2A 100%);
				font-size: 30rpx;
				font-weight: bold;
				color: $uni-text-color-inverse;
				border-radius: 42rpx;
			}
		}
	}
</style>
